package com.icode.web.filter;

import org.sitemesh.builder.SiteMeshFilterBuilder;
import org.sitemesh.config.ConfigurableSiteMeshFilter;

/**
 * User: alexz
 * Date: 2015/1/22
 * Time: 15:37
 */
public class SiteMeshFilter extends ConfigurableSiteMeshFilter {
    private static final String MAIN_DECORATOR_PAGE = "/WEB-INF/decorator/main.jsp";
    private static final String MINOR_DECORATOR_PAGE = "/WEB-INF/decorator/minor.jsp";
    private static final String EMPTY_DECORATOR_PAGE = "/WEB-INF/decorator/empty.jsp";

    @Override
    protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
        builder.addDecoratorPath("/**", MAIN_DECORATOR_PAGE);

        builder.addDecoratorPath("/login", MINOR_DECORATOR_PAGE);
    }
}
